SwitchIf in Button to Duplicate different pages

HI All,

I need some help please - I think I am looking at the back of my eyelids…

I have a button, that duplicates a stencil/template page when a new meeting is started. I now have a need to duplicate different pages, depending on the meeting.

  1. If the meeting is for Francois’ weekly meeting, it needs to pull in the page “Stencil - Wk Francois”. For all other meetings it needs to pull in the Generic stencil. However, the SwitchIf () ALWAYS follows the first branch. What am I missing?
  2. In the formula version of duplicate page, I do not see the ability to store the newly created page result into a column. Which is sort of nice to be able to do. If that is not possible, I will have to go back to creating two duplicate page buttons.

Here is a clean version of the doc:

Thank you very much
Piet

How about creating a separate table listing the relevant templates for the type of meeting, adding a duplicate button to that table, and then using a lookup to bring in the relevant button only, according to the type of meeting?

I have a similar use-case where I want to duplicate different “template” pages for a homework reports, based on the type of homework being completed.

Let me know how you get on.

Thanks!

Lorraine

1 Like

Thanks, I will try this, should work.

So many ways!

This is a solution to solve my problem, but the other half is still what am I missing in the SwitchIf, so forgive me that I do not mark as solved quite yet.

Thanks
Piet

Addressing point 2 in your original post, you can still store the new page in your row. I have a use case that does something like this, using switchifs. This is how my formula looks, you end up nesting the duplicatepage function inside the modifyrow function:

Switchif( 
  
  
  thisRow.[First Letter] = "A",
   
      ModifyRows(thisRow,thisRow.Page, DuplicatePage([Single Film Template], name: thisRow.Name, parentPage: A)), 
  
 thisRow.[First Letter] = "B",
   
      ModifyRows(thisRow,thisRow.Page, DuplicatePage([Single Film Template], name: thisRow.Name, parentPage: B))

Oh and using the filter function as you did in the code in the first post is unnecessary. Might be why the switchif was always defaulting to the first one

Thanks, I’ll try. 12345678901234567890