Question about the "Receive Shared Files" property

Hello Kodular community,

First of all I want to thank all of you for sharing your knowledge with newbies like me. It has been possible for me to start creating apps since a couple of weeks ago and your posts with answers, extensions and all the information shared have been extremely helpful. I was able to develope an app for navigation in my professional field which is oil and gas exploration. With this app the user can import geographic information (Markers and Polylines) from files such as JSON and CSV in the Google Maps component and then navigate to this features in the field, the user also can collect features and store them in the mobile device and export them to a text file for later process on a laptop or desktop computer. My question about the “Receive Shared Files” property is for the Text type, I was testing the property and realized that for the option “Text” the “value” variable inside the “Got Received Shared” event does not throw a path to the file shared if the file is of TXT type but it does it if the file is an image file (JPG) the only way I could make it work was “faking” the extension of the TXT file from TXT to JPG, this way the variable “value” inside the “Got Received Shared” event returned a path and my app was able to load the markers in the map. Is there any way this Event can return a path to the TXT shared file if the file is of TXT type? BTW I also realized that if I open the TXT file with a text reader, select the whole text and then share it with my app the “value” variable returns the selected text. Wouldn’t be awesome that “value” returned a path when a TXT file was selected? I am using FileTools extension and the File component to read the file. I hope the description of my issue was clear enough and I am posting a pictures of my blocks as well. Thanks in advance.

2 Likes

Hi welcome the community,
Documentation Reference:
Type stand for integer. 0 = nothing shared, 1 = audio, 2 = image, 3 = text (perhaps this helped you) or 4 = video
I don’t test this component. I can say this only work on Screen1. More info:

Thanks for your response, I am just wondering if there is a way that when the file is of text type (TXT extension or some other that contains text only) is shared to my app, the “value” variable inside the “Got Received Shared” event return a path to the file, if not, it would be great if this was implemented since if I “fake” the extension for the text file (TXT or CSV) to JPG the “value” variable returns a path and my features are loaded to the map.

I’ve been looking in the community posts and also googled it and there’s no information about it.

Thanks a lot.

Sorry i don’t test or used this component for now.
Trie on when Screen1 Got Received Shared (block)
If value = 3 (text) - true - them do what you need to do.
blocks (16)

Thank you, but when I select the file to share if it is of text type the response from “type” is 0 not 3 so it doesn’t work that way. If I open the file with an external text reader app and select the text and then share the text with my app the response from “type” is 3 but that is not what I want to do. Cheers.

You need to created a condition to check each type.
Whit these blocks you can check all types.
blocks (19)
I hope this help you

Any follow up to this problem? If the type is 0, then the value is empty means you received nothing. Tried on .txt and .csv and the return type is 0, however as Santiago said, if its a raw text, sentence or words and shared, the type becomes 3.