cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Wilder1626
Helper II
Helper II

PowerApps - Update Dynamics Table column based on DropDown Column Name Value

Hi

I would like to be able to Update a specific column value in my Dynamics 364 table based on the Column name selected in a Drop Dowm menu. Based on the value selected from the drop down, it will select proper columns to action on the Patch.

 

This portion: scl_tscauditrequestid = GUID(txTscAuditRequestNumber.Text)  will search for the unique value.

 

Then, if i select a value in my Drop Down menu that equals a column name inside that table, Example: "slc_Comments:", when i will press on the button, it will put the value from txNewValue.Text into "slc_Comments" column of the row corresponding to unique value that equals

to GUID(txTscAuditRequestNumber.Text) 

 

 

 

 

Patch(
        'Audit dbase',
        LookUp(
            'Audit dbase',
            scl_tscauditrequestid = GUID(txTscAuditRequestNumber.Text)
        ),
        {
            cbDbColumnSelection.Select.Value = txNewValue.Text
           
        }
    )

 

 

 Above code does not work. But how can i do that?

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @Wilder1626 ,

 

You cannot use a selected text value to refer to a column name.

So, you could modify the formula like this:

If(cbDbColumnSelection.Select.Value="slc_Comments",
Patch(
        'Audit dbase',
        LookUp(
            'Audit dbase',
            scl_tscauditrequestid = GUID(txTscAuditRequestNumber.Text)
        ),
        {
            slc_Comments = txNewValue.Text
           
        }
    ),
cbDbColumnSelection.Select.Value=Another column Name,
Patch(
        'Audit dbase',
        LookUp(
            'Audit dbase',
            scl_tscauditrequestid = GUID(txTscAuditRequestNumber.Text)
        ),
        {
            Another column Name = txNewValue.Text
           
        }
    ))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @Wilder1626 ,

 

You cannot use a selected text value to refer to a column name.

So, you could modify the formula like this:

If(cbDbColumnSelection.Select.Value="slc_Comments",
Patch(
        'Audit dbase',
        LookUp(
            'Audit dbase',
            scl_tscauditrequestid = GUID(txTscAuditRequestNumber.Text)
        ),
        {
            slc_Comments = txNewValue.Text
           
        }
    ),
cbDbColumnSelection.Select.Value=Another column Name,
Patch(
        'Audit dbase',
        LookUp(
            'Audit dbase',
            scl_tscauditrequestid = GUID(txTscAuditRequestNumber.Text)
        ),
        {
            Another column Name = txNewValue.Text
           
        }
    ))

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Wilder1626
Helper II
Helper II

Thanks. This will work.

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 (2,482)