How do I initialize DDX Form Brick with Existing Dataset and then sync it to an AppDB collection

alzwang99
alzwang99 Member
edited March 25 in APIs & Domo Developer

I was tinkering with the DDX Form and Dataset Brick and I want it where the table initializes with an existing dataset using domo.get(`/data/v1/${datasets[0]}`);

and have it update into the new/existing app collection that is syncing to the brick, domo.get(`/domo/datastores/v1/collections/${collectionName}/documents`).

For some reason I cannot get it to sync as it shows blank even though the sync is enabled and the schema is set up correctly

Been scratching my head of how this works in the first place.

My intention is to utilize an existing dataset. Use the brick to make manual adjustments. Have these manual adjustments recorded in the app collection and then rejoin the data back to the initial dataset.

Tagged:

Answers

  • brycec
    brycec Contributor

    In order to add or modify documents in a collection, you'd need to use a PUT request. You might already be doing this, but all I see in your post is your domo.get request, which would need to be domo.put.


    Also, you might want to look into using the table section component on the Form Builder app or the Inline Editing app.

    Was this comment helpful? Click Agree or Like below.
    Did this comment solve your problem? Accept it as the solution!

  • alzwang99
    alzwang99 Member
    edited March 26

    By Default, there is a runSync() function and it is triggered by a onclick Event from a sync button. What I don't understand is why it is a post request to /domo/datastores/v1/export instead of something like a put request of /domo/datastores/v1/collections/${collectName}/documents/

  • brycec
    brycec Contributor

    That's odd. I haven't run across that endpoint ever. When you manually sync something in the AppDB viewer, it does a PUT request like I was saying. You could try to just switch to the PUT request for documents, seeing as that POST request isn't working anyway.

    Was this comment helpful? Click Agree or Like below.
    Did this comment solve your problem? Accept it as the solution!