cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FelipeCaru
Level 8

Invalid value for field, expected a string

Hello all,

I have a problem with my app now. In my Excel sheet I have a column called 'Completado' which has either 0 or 1, and the column is formatted as 'text'. In PowerApps, in an editform I have the formula:

If(DataCardValue28.Value=true,Text(1),Text(0))

And also tried variants with "1" and "0".

When I go to save the form, I have on the SubmitForm(form_ELT); the error, where the error says:
The requested operation is invalid. Server response: invalid value '0' for field 'Completado', expected a string.

I am having troubles with this since I already have the column in the Excel Sheet as text field, and the value of the card on the 'update' property has the formula shown above, which should make it text/string, yet, still have this error.

What can I do?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Invalid value for field, expected a string

Hi @FelipeCaru ,

 

What is the control type of DataCardValue28? Is it a toggle control?

 

Please try below formula instead:

If(DataCardValue28.Value=true,"1","0")

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: Invalid value for field, expected a string

Hi @FelipeCaru ,

 

What is the control type of DataCardValue28? Is it a toggle control?

 

Please try below formula instead:

If(DataCardValue28.Value=true,"1","0")

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
FelipeCaru
Level 8

Re: Invalid value for field, expected a string

@v-monli-msft 

I did had that tried but didn't work.

However, I just noticed why nothing worked: originally, when the form was made, the column was in number format, thus, the card had number format. Now much later the source has it as text, but the form still had it as number, therefore the problem. I re-did the card and used the formula, and then all worked good.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 72 members 4,092 guests
Please welcome our newest community members: