Orchardcore: How to Create Bag Content item through Create Content Task in workflow???

Created on 30 Jan 2020  路  5Comments  路  Source: OrchardCMS/OrchardCore

Content Properties

"Message": {
    "ContentItems": [
        {
            "MessageItem": {
                "ContentItems": [
                    {
                        "MessageItem": {
                            "InputFielName": {
                                "Text": "{{ Request.Form.Name }}"
                            }
                        }
                    }
                ]
            }
        }
    ]
}

Most helpful comment

Ok create one content item of this Content Type. Make sure you add a MessageItem to this content item. Then open this content item to edit it. Look at the url and copy the GUID part of this url which tells you the ContentItemId of this content item. Then open up your database and look at the ContentItemIndex table and do SELECT * FROM ContentItemIndex LEFT JOIN Document ON ContentItemIndex.DocumentId = Document.Id WHERE ContentItemIndex = 'YOUR COPIED GUID'.
Copy the Document.Content column content and paste it on this nice online json editor :
https://jsoneditoronline.org/
Then look at the JSON structure and try to copy it in your Workflow.

All 5 comments

Create one content item with a bag part item and look in the database to get a sample. Or simply export it. This doesn't look like proper JSON for a bagpart.

"Message" Content Type is already created with bag part "MessageItem" which have 4 fields.
We're trying to get the inputs from the form using the workflow task " Create Content Task" and put them in the MessageItem fields.

We can't figure out the JSON codes to create Message content type and have the bag part already added.

Capture

Ok create one content item of this Content Type. Make sure you add a MessageItem to this content item. Then open this content item to edit it. Look at the url and copy the GUID part of this url which tells you the ContentItemId of this content item. Then open up your database and look at the ContentItemIndex table and do SELECT * FROM ContentItemIndex LEFT JOIN Document ON ContentItemIndex.DocumentId = Document.Id WHERE ContentItemIndex = 'YOUR COPIED GUID'.
Copy the Document.Content column content and paste it on this nice online json editor :
https://jsoneditoronline.org/
Then look at the JSON structure and try to copy it in your Workflow.

working

It works, Thank you. (Y)

Related #5439

Was this page helpful?
0 / 5 - 0 ratings

Related issues

superluminalK picture superluminalK  路  4Comments

randaratceridian picture randaratceridian  路  3Comments

cbadger360 picture cbadger360  路  4Comments

jeffolmstead picture jeffolmstead  路  4Comments

jardg picture jardg  路  3Comments