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

Power apps Submit Form adding data to hidden fields

I have Power Apps New Request Form and Data verse table. I have to create new request form and store the data into Data verse.

I am using "SubmitForm"  function to store the value. But i have to maintain choice column for capture the status,like Once I select the draft button data needs to stored as "Draft" same way submit button to save as "Submitted".

 

Can anyone help on this?I have used global variable but it is working when the fields are not hidden but I made visible to false and submit is not updating the status.

1 ACCEPTED SOLUTION

Accepted Solutions
v-albai-msft
Community Support
Community Support

Hi @gowtham1907 ,

From your description, I know that:

1. You have a form with some fields that need to be populated by users.

2. In your Dataverse, there is also a Choice field(for example, this field called “Status_choice”) and this field does not display in above form.

3. Outside the form, there are two button, one is “Draft” button, the other is “Submitted” button. When click Draft button, you want to create new record with Status_choice =Draft, when click Submitted button, you want to create a new record with Status_choice =Submitted.

 

If my understand is correct, you can try below formula for these two button. 

Before apply below formula, make sure your Choice field has options like below:

v-albai-msft_0-1620896916063.png

 

For Draft button, set OnSelect property to(There are two fields in my form):

Patch('Expense Nature Categories',Defaults('Expense Nature Categories'),
{'Expense Nature Category (cre5c_name)':DataCardValue13.Text,
'Category  ':DataCardValue16.Text,
Status_choice:Status_choice.Draft})

 

For Submitted button, you can try this formula:

Patch('Expense Nature Categories',Defaults('Expense Nature Categories'),
{'Expense Nature Category (cre5c_name)':DataCardValue13.Text,
'Category  ':DataCardValue16.Text,
Status_choice:Status_choice.Submitted})

 

On your side, you should try formula like this(edit below DataverseName and ColumnName(inside your form) based on your requirement):

Patch(DataverseName,Defaults(DataverseName),{
ColumnAInForm:DataCardValue1.Text,
ColumnBInForm:DataCardValue2.Text,
...
ChoiceColumnName:ChoiceColumnName.Draft
})

Best regards,

Allen

View solution in original post

2 REPLIES 2
Sid_Jafri
Responsive Resident
Responsive Resident

Hi @gowtham1907 ,

 

You can use Patch function for that or make that field visible and disabled it if it is working on visible.

 

Please Thumbs up and accept as solution if my post helped you solve your issue.

 

v-albai-msft
Community Support
Community Support

Hi @gowtham1907 ,

From your description, I know that:

1. You have a form with some fields that need to be populated by users.

2. In your Dataverse, there is also a Choice field(for example, this field called “Status_choice”) and this field does not display in above form.

3. Outside the form, there are two button, one is “Draft” button, the other is “Submitted” button. When click Draft button, you want to create new record with Status_choice =Draft, when click Submitted button, you want to create a new record with Status_choice =Submitted.

 

If my understand is correct, you can try below formula for these two button. 

Before apply below formula, make sure your Choice field has options like below:

v-albai-msft_0-1620896916063.png

 

For Draft button, set OnSelect property to(There are two fields in my form):

Patch('Expense Nature Categories',Defaults('Expense Nature Categories'),
{'Expense Nature Category (cre5c_name)':DataCardValue13.Text,
'Category  ':DataCardValue16.Text,
Status_choice:Status_choice.Draft})

 

For Submitted button, you can try this formula:

Patch('Expense Nature Categories',Defaults('Expense Nature Categories'),
{'Expense Nature Category (cre5c_name)':DataCardValue13.Text,
'Category  ':DataCardValue16.Text,
Status_choice:Status_choice.Submitted})

 

On your side, you should try formula like this(edit below DataverseName and ColumnName(inside your form) based on your requirement):

Patch(DataverseName,Defaults(DataverseName),{
ColumnAInForm:DataCardValue1.Text,
ColumnBInForm:DataCardValue2.Text,
...
ChoiceColumnName:ChoiceColumnName.Draft
})

Best regards,

Allen

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

secondImage

Power Apps Community Call

Please join us on Wednesday, October 20th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,361)