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

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
Highlighted
Super User II
Super User II

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)
Highlighted
Frequent Visitor

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.

Highlighted
Frequent Visitor

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,525)