cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jo_25
Helper I
Helper I

Duration field in Sharepoint not updated although global variable - _requestedDays was updated by the Compute button

I have a compute button in powerapps to compute no of leave requested.  

The compute button is working well to compute the no of leave requested and stored it in a global variable - _requestedDays. However, the Duration field (which is a number field in Sharepoint) is not being updated with the _requestedDays when I do a SubmitForm to create the new record in Sharepoint. 

I read from some forum post that I need to set the Default property of the Duration card to 

If(!IsBlank(_requestedDays), _requestedDays, ThisItem.Duration) but somehow Duration field in Sharepoint is not updating.  See screen capture below. How can the Duration field be updated?  I have been trying the whole afternoon to get the field updated but without much success. Please help!!!! 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Jo_25 ,

You can forget about all that complexity - the Update property simply wants to know what you want to put in the SharePoint field it is linked to. The DataField of the Card should be

"Duration"

and the Update if this is a Numeric field is to turn the text input into the number required which is

Value(YourTextBoxName.Text)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

6 REPLIES 6
WarrenBelz
Super User III
Super User III

Hi @Jo_25 ,

What is the Update of the Data Card and can you see the days in the field before you submit?

The Update should be 

Value(YourTextBoxName.Text)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Jo_25
Helper I
Helper I

Hi, Warren

Strangely, there is no Update property for this data card. Not sure why?

Yes, I can see the computed value in the value field of the Datacard Duration as I have set the Text property of that field to _requestedDays. But this value don't get updated to Sharepoint Duration field when the OnSelect SubmitForm is activated. 

 

Based on a forum I read, it said that I could update the value of the DataCard field by using the Default property of the DataCard Duration . In Default field for the datacard, I used this argument - If(IsBlank(_requestedDays),ThisItem.Duration, _requestedDays) where _requestedDays is a global variable which I have set to "0" OnStart of the Apps.  

The global variable, _requesteddays is being used in the Compute button to compute no of days of annual leave taken. 

 

The post also require me to initialise the value of _requesteddays to blank in the OnSelect SubmitForm button. However, I had some problem doing this as _requestedDays is numeric. Because of this, I used this argument Set(_requestedDays,Value("")).  With this argument there, the Duration field is not updated. 

 

However, the solution did not update the field in Sharepoint. 

I therefore do not know how to proceed from here. 

Any help would be much appreciated!!

Hi @Jo_25 ,

You can forget about all that complexity - the Update property simply wants to know what you want to put in the SharePoint field it is linked to. The DataField of the Card should be

"Duration"

and the Update if this is a Numeric field is to turn the text input into the number required which is

Value(YourTextBoxName.Text)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Hi, Warren

I just reinserted the Duration field from the data source and Powerapps gave me a new data card. I saw the update property in the new Duration card. I think I must have done something that cause the update property to be missing in the old card. I deleted the old card and now the value is showing and the Sharepoint field is being updated when SubmitForm is activated. I learnt from this episode not to anyhow change the data card. I have much to learn from you. Still an amateur in Powerapps. Many thanks for your help, Warren and have a good day ahead. 

Thanks @Jo_25 ,

You can change things as much as you need once you fully understand what the various properties of a control are doing and how they do it.

Please remember to mark the post that assisted the most as the Solution (as it answered the question your posted)

Hi @Jo_25 ,

You must have inserted a custom card and put the controls in it. These cards do not have an Update Property as they are generally used for other things. 

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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (70,712)