0

I have a SharePoint form - customized with PowerApps - that contains 6 currency fields from SharePoint.

The first 5 are meant for user input, and the 6th is for totaling the 5 fields' values.

For an example of my issue, here's what I have for my first currency field (Air Cost):

OnChange:

UpdateContext({varFormat: Self.Text});
Reset(Self)

Default:

If(
    !IsBlank(varFormat),
    Text(
        Value(varFormat),
        "$#,##0.00"
    ),
   Parent.Default
)

Datacard Update property:

Value(DataCardValue37.Text)

So what I need is for this field to convert to USD while the user enters information in the form. It does this correctly, and after submission, displays correctly in SP.

When an Approver then opens that form, those fields are displaying correctly again in the form, BUT they can't be modified. If an Approver changes the value of one of those fields, the formatting goes away, and it won't update that field in SharePoint.

I don't know why this is happening. Maybe I need to set my variable on the OnStart property?

It's causing an issue because these Cost fields are "estimated", so they will frequently need to change. How can I set these fields up so that this can work?

Thank you!

2
  • 1
    You can set the varFormat variable to the column value in App.OnStart or Form.OnNew, Form.OnEdit, etc. Or set Default property to: If( !IsBlank(varFormat), Text( Value(varFormat), "$#,##0.00" ), Text(Parent.Default,"$#,##0.00") ). Let me know if this works for you. Feb 26 at 13:25
  • Thank you Ganesh. Based on my field's OnChange/Default property, how would I set that on the OnStart property? I plugged in the Default property you suggested, but it still loses it's formatting when in Edit mode - and won't update in SP.
    – Chris
    Feb 26 at 13:59

1 Answer 1

1

Try this:

Set OnChange property of text input control to:

Set(varFormat, Self.Text);
Reset(Self);

Set Default property of text input control to (same as given by you):

If(
    !IsBlank(varFormat),
    Text(
        Value(varFormat),
        "$#,##0.00"
    ),
   Parent.Default
)

Set OnView property of SharePointIntegration control to:

ViewForm(SharePointForm1);
Set(varFormat, Text(SharePointIntegration.Selected.'Air Cost'));

Set OnEdit property of SharePointIntegration control to:

EditForm(SharePointForm1);
Set(varFormat, Text(SharePointIntegration.Selected.'Air Cost'));

Make sure to use the correct name of your column in the formula and publish your changes to SharePoint from Power Apps.

1
  • 1
    Thank you! All set now
    – Chris
    Feb 27 at 18:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.