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

Patch collection with value from a calculate textbox

Hello,

I created a collection from a Sharepoint list, I want to update the values, so I created a gallery in which I put textboxes. Except that I have a text entry with a calculation formula that is A - B(TimeCumulate). The result is displayed but is not taken into account as if it was not validated but when I manually put the value in the text entry, the result is taken into account and the sharepoint list is updated.

Do you know how to solve this problem?

Thanks in advance

 

I put this code on the "OnSelect" of the Gallery

 

 

Patch(ColTempData;ThisItem;{TimeJustif:Value(TimeCumulate.Text);Contrat:TimeContrat.Text})

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Kaotech,

A tip for you, you know everything important in you scenario because you are the one who builds this app, which control and which property, set for which field. However, I could not imagine this at all.😂

 

If you just want to make the If() statement to update the field in your List, I am afraid that it is impossible.

 

The reason why the Patch() function works is that you reference to the calculate result within the TextInput directly and Patch() do the saving thing.

However, the If() statement only update the calculate result, it could not save the result to the data source.

Best Regards,
Qi

View solution in original post

3 REPLIES 3
v-qiaqi-msft
Community Support
Community Support

Hi @Kaotech,

What do you mean that "The result is displayed but is not taken into account as if it was not validated but when I manually put the value in the text entry, the result is taken into account and the sharepoint list is updated."?

Could you please tell me that how you write the formula for the calculation?

 

If you have the calculated result within the TimeCumulate TextInput, you could update the TimeJustif with the text directly.

In addition, time differ uses the DateDiff

DateDiff(DateTimeValue(TimeB.Text),DateTimeValue(TimeA.Text),Days)

 

Best Regards,
Qi
Kaotech
Frequent Visitor

Hello @v-qiaqi-msft 

 

Formula is : 

 

 

If(Checkbox2.Value=true;ThisItem.KCRECTIME-AgentTimeJusti;"")

 

 

 

On the attached file ('Checked_box.png) , when i check the box, the calcul is done, but the result is not patched on the sharepoint list. If i put the resultat manually in the box and press enter on my keyboard the result is patched (manually_entry.png).

 

Best Regards

Hi @Kaotech,

A tip for you, you know everything important in you scenario because you are the one who builds this app, which control and which property, set for which field. However, I could not imagine this at all.😂

 

If you just want to make the If() statement to update the field in your List, I am afraid that it is impossible.

 

The reason why the Patch() function works is that you reference to the calculate result within the TextInput directly and Patch() do the saving thing.

However, the If() statement only update the calculate result, it could not save the result to the data source.

Best Regards,
Qi

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,433)