cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
maxtarneberg
Level: Powered On

SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean

Hi,

 

I am trying to save images that are added into my Collection called MyPicture using the following code:

According to the syntax I have seen it is simply SaveData(Collection,"FileName")

 

My code added to a Submit Button:

 

OnSelect Navigate(BrowseScreen1,ScreenTransition.Fade) & SubmitForm(Form1) & SaveData(MyPicture, "Photos")

 

However I am getting this error:

Invalid Argument Type, Expecting one of the follwing, Text, Number, Boolean.

...and I have no idea why because "Photos" is clearly Text

 

Questions:

1) Where am I going wrong with the syntax?

2) Where is this trying to save things, and do I need a datasource to do so? I would like to use one.

3) Is this the stage where I make up a filename e.g. "Photos" or should there already be a place called "Photos"?

 

Many thanks in advance,

Max

 

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean


Questions:

1) Where am I going wrong with the syntax?


 

To add multiple statements in a single expression, you should use the semicolon ( ; ) to separate them, not the ampersand ( & ). Something like this would work:

Navigate(BrowseScreen1,ScreenTransition.Fade); SubmitForm(Form1); SaveData(MyPicture, "Photos")

2) Where is this trying to save things, and do I need a datasource to do so? I would like to use one.


 

SaveData will save in the local storage of the device. If you want to save images on a data source, then SaveData is not your friend. There are some data sources that support images (CDS, Excel on Dropbox/OneDrive/Google Drive), and some that don't.


3) Is this the stage where I make up a filename e.g. "Photos" or should there already be a place called "Photos"?

 

"Photos" is the name of an internal file where the collection (MyPicture) is saved, which you can access via the LoadData function.

View solution in original post

5 REPLIES 5
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean


Questions:

1) Where am I going wrong with the syntax?


 

To add multiple statements in a single expression, you should use the semicolon ( ; ) to separate them, not the ampersand ( & ). Something like this would work:

Navigate(BrowseScreen1,ScreenTransition.Fade); SubmitForm(Form1); SaveData(MyPicture, "Photos")

2) Where is this trying to save things, and do I need a datasource to do so? I would like to use one.


 

SaveData will save in the local storage of the device. If you want to save images on a data source, then SaveData is not your friend. There are some data sources that support images (CDS, Excel on Dropbox/OneDrive/Google Drive), and some that don't.


3) Is this the stage where I make up a filename e.g. "Photos" or should there already be a place called "Photos"?

 

"Photos" is the name of an internal file where the collection (MyPicture) is saved, which you can access via the LoadData function.

View solution in original post

maxtarneberg
Level: Powered On

Re: SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean

Hi @CarlosFigueira

 

Thank you so much for your help with this, it is much appreciated.

 

If SaveData is not my friend, what is? Is is Patch?

 

Max

Power Apps Staff CarlosFigueira
Power Apps Staff

Re: SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean

Yes, you can use Patch to store data; you can take a look at one of the template apps (New -> App Templates; choose the Site Inspection, for example) for an example of saving photos.

maxtarneberg
Level: Powered On

Re: SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean

Thank you @CarlosFigueira for your help, much appreciated.

Sibalukhulu
Level: Powered On

Re: SaveData Invalid Argument Type, Expecting one of the following, Text, Number, Boolean

It depend on the region on when not to use the " & " the semicolon doesn't work for me always comes up with an error until I separate with &

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,956)