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

PowerApps-SharePoint forcing a text field to become a number

I have a Sharepoint text column, "month". It is intended to have 01, 02, 03... 12.

 

I have a PowerApp, connected to it. The text field to modify this column is working not ideally.

 

When I enter months 1-9 (1 digit), in the way 01, 02, 03... The EditForm operation is sending 1, 2, 3 instead of what I want. I have tried multiple things to fix this but I cannot get it right.

 

Any suggestions?

1 ACCEPTED SOLUTION

Accepted Solutions
Wichowich
Level: Powered On

Re: PowerApps-SharePoint forcing a text field to become a number

Thanks for your suggestions!

 

@KennethNicasens. Thanks for your suggestion. But it didn't work.

 

@mdevaneyYour suggestion/code gets the right format, even just before submitting. I was able to put the output of the box into a variable and it was getting what I wanted. But SharePoint would resist.

 

I had a problem once, with custom editforms, so I decided to remove the field and place it back again, in order that the data card was not "custom" and was just automatic without any modifications, and that worked. So basically, I think there is a bug when you unlock them, something underneath that makes it work not so well, particularly in this scenario.

 

Thanks so much for hanging in with me. This was so frustrating!

View solution in original post

10 REPLIES 10
Super User
Super User

Re: PowerApps-SharePoint forcing a text field to become a number

@Wichowich 

Use this code in the UPDATE property of the card for Month to show the format you desire

Text(Value(TextInput_Month.Text),"00")

 

When the data is submitted to SharePoint it will now show "01" for January instead of "1"

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Re: PowerApps-SharePoint forcing a text field to become a number

What I also found is that if you edit the Format option of the textbox you are using to Number he will also just write 01 instead of 1.

2020-02-14 14_55_17-Workspaces on Workspace forms - Power Apps.png

Wichowich
Level: Powered On

Re: PowerApps-SharePoint forcing a text field to become a number

Hi,

 

I have tried what you suggested, but it is resisting to this. Any thoughts?

 

W

 

 
Wichowich
Level: Powered On

Re: PowerApps-SharePoint forcing a text field to become a number

Kenneth,

 

You mean the opposite, right? Do I have to set it up in Number or Text?

 

W

Super User
Super User

Re: PowerApps-SharePoint forcing a text field to become a number

@Wichowich 

Can you please confirm the Format property is set to Text?  And also, please confirm the Month column in SharePoint is single-line text.

 

It might be helpful to see the "non-advanced" properties from the right side menu as a screenshot as well 🙂

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Re: PowerApps-SharePoint forcing a text field to become a number

@Wichowich 

 

Yes, Sorry in the screenshot I didn't change the value to Number.

 

If I do this I am only allowed to fill in a Number and if I send this to Sharepoint he will save this as 01

Wichowich
Level: Powered On

Re: PowerApps-SharePoint forcing a text field to become a number

Hi  @mdevaney,

 

SharePoint column set to single line text. And format of box set to text format.

 

 

Super User
Super User

Re: PowerApps-SharePoint forcing a text field to become a number

@Wichowich 

I think I see the problem.

 

You must change the Default property of DataCard13 to one of these.  Try each of them and let me know what works.

Text(Value(ThisItem.Month),"00")
Text(ThisItem.Month,"00")

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Re: PowerApps-SharePoint forcing a text field to become a number

Hi @Wichowich ,

 

If @mdevaney  his solution doesn't work, can you set the format of the box to Number?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

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 (5,116)