cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
RemcodeB
Level: Powered On

Can I store multiple checkbox values into one excel column

I have a a Canvas app with a question for which multiple answers are possible. In the Edit form I want to show the answers as checkbox choices. The answers are stored in an Excel table.

In the Display form the answers can be presented as lines of text, but it must also be possible to change the answers (check new answers and uncheck earlier answers).

Is it possible to store all answers in one column or do I have to use a yes/no column for each answer.

Are there other options to store all answers in one column?

3 REPLIES 3
PowerAddict
Level 10

Re: Can I store multiple checkbox values into one excel column

Hi,

You can store all answers in one column. You can do this by collecting all the answers in one collection based on whether the checkbox for a particular answer is checked or unchecked.

The OnCheck property of the check box will be something like:

Collect(CollectionName, Answer)

And the OnUncheck property will be:

Remove(CollectionName, Answer)

The way you specify Answer in the above expressions might be diff for you. If the answers are in a gallery, then it will be something like ThisItem else you can reference the checkbox control name.

Once all answers have been collected, you can patch the collection back using ForAll function.

ForAll(Collection, Patch(Excel, {Answers: Value}))

These expressions are just for reference. Yours might look different.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit(Haman)
RemcodeB
Level: Powered On

Re: Can I store multiple checkbox values into one excel column

I have set the OnCheck property to:    Collect(MyInvestment, "Time")    where the MyInvestment is the CollectionName and Time is the text to be added.  This is accepted without errors.

When I set the OnUncheck property to:    Remove(MyInvestment, "Time")     an errormessage is displayed which says: The function'Remove' has some invalid arguments.

When I checked the Remove documentation I saw you have to filter the value that has to be removed.

With this statement the errormessage is gone:    Remove(MyInvestment, First( Filter(MyInvestment, Value="Time") ) )

 

Now I can store multiple values in one excel column, thank you for your support.

RemcodeB
Level: Powered On

Re: Can I store multiple checkbox values into one excel column

I was a little bit too fast in saying that I can store multiple values in one column.

To patch the collection into the Excel column I used this statement in the Update property of the DataCard:

ForAll(MyInvestment, Patch(<TableName>, {<ColumnName>: Value}))

But then the error message says:

The property on this control expects Text values. The rule produces Table values which are incompatible.

How do I store the collection values in one cell?

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,954)