I recently created a json file I added it to the assets of the application and I wanted to read its data using the blocks of the dictionary but I did not find a way to do it
Is there any way to do that?
Read file using File
component and then get the json value from GotText
event.
Thanks for your reply, but it requires storage permission and it could be a bit problematic for users who have not approved it
Is there another way?
Yes, there is always at least one workaround.
Whats happen ?
Give us more details.
How about putting it as text in a variable or string?
that could also be a way to achieve this.
I mean, you should open that json file, copy and paste it in your project as a variable or string or whatever that can return that text, then you can easily use it as dictionary
I’m not getting any response
I think it works same as File component so to read file from assets you should use //
.
Also you should always use absolute file path.
exactly…
this should work as file name: //file.json
Taifun
Yes, and there is no need to use the EFile ext. in this case.
No, see this post in the Power User forum (AI2) from the MIT team:
Thanks for the suggestions but unfortunately I still do not get any response
I’ll be happy if you can check out the projecttest.aia (20.3 KB)
thank you for the answer!
So it turns out I should have just written it like this:
Sorry for my lack of understanding
Thanks to all the helpers!
Usually you can use File component but you should start looking for alternatives if you are concerned about unwanted permissions.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.