cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wichowich
Frequent Visitor

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

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
mdevaney
Super User III
Super User III

@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."

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

Hi,

 

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

 

W

 

 

Kenneth,

 

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

 

W

@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."

@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

Hi  @mdevaney,

 

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

 

 

@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." 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (56,813)