DEV Community

Andrew Elans
Andrew Elans

Posted on

Power Pages: Content Snippets with a HACK part 3

To create a new model-driven app to manage custom snippets we need first to do some other things.

Since I have just provisioned a new environment, I would like to create a new solution to have all components in one place. How to do this is explained here.

Environment Architecture

I will be building SPA for Supply Chain. Before I start to create solution objects, I need to define a strategy with access groups.

At minimum I will have 2 groups:

  1. Procurement personnel with access to all supplier info and functionality
  2. Other employees with limited access.

I decide to use default Power Pages tables that start with mspp_ prefix for the procurement users only. For the others I will create a new content snippets table called wb Common Content Snippets. Users outside procurement will not have access to mspp_contentsnippets. All employees will have access to wb Common Content Snippets.

Create a new custom Content Snippets table

We need to partially replicate the standard Content Snippets (mspp_contentsnippet) so that our custom content snippets can work with the script mspp_contentsnippet.js.

Go to make.powerapps.com -> Your Env -> Tables -> click Create table -> select Table (advanced properties) -> type in Display name wb Common Content Snippet -> expand Advanced options -> correct Schema name to wb_CommonContentSnippet -> in Primary column tab -> correct Display name to wb Name -> click Save.

In this newly created table select Columns -> create new columns:

  1. wb Value: Display name wb Value -> Data type Text -> Multilines of text -> Plain text -> Format Text -> Schema name wb_Value -> Maximum character count 1048576
  2. wb Type: Display name wb Type -> Data type Choice -> Choice -> Sync with global choice Yes-> click New choice -> Display name wb Content Snippet Choice -> Label Text, Value 756150000 -> click New choice -> Label HTML, Value 756150001 -> expand Advanced options -> adjust Name to wb_ContentSnippetChoice -> click Save -> select in Sync this choice with wb Content Snippet Choice -> Default choice HTML -> expand Advanced options -> adjust Schema name to wb_Type -> click Save.

Here is our table:

Image description

To be continued in Part 4

How to create new model-driven app to manage the snippets will be shown in the next chapter...

Top comments (0)