Workflow: CRUD operation on modules/pages

Hi there!

I’m pretty new to corteza and i’m trying to learn, is a bit hard due to the lack of tutorial (and the documentation is a bit tricky), however i’m actually stuck at :

  • I’ve already created a new Namespace + module + page, a really simple one with just an ID and a Value

what i’m trying to do is to perform some CRUD operation on it using the workflow, but i don’t even know where to start.

at the moment i’ve set up a manual trigger [System - onManual] and a function that tries to read the key/value from the module.
the function is [Compose record Lookup].

What confuse me is that when i search for the record i’ve got an array [] with one or more object inside {}, but these object(s) are always empty…

so i tried to figure it out doing something different such as create a new record but there’s no way i can make it work…

really need some help guys, thanks

welcome @cromalde to the comunity

regarding the search function, you need to specify the namespace, module, and the query to retrieve the right result

regarding the query, the docs are there but think of it as the where clause in SQL

Thanks,

I’m using the correct namespace and module, and i don’t know if the query is the problem because if i start the workflow WITHOUT the query i still have as result something like " [{},{}] "
and this is almost right 'cause in these test module i’m using i’ve got just 2 entries so it’s like the workflow found it but can’t grab the value of it, actually i’m trying to play around with permissions, the workflow is not executed by anyone ( the Run As is blank)

I don’t think the permission is the issue (the invoker of the workflow will be considered if you didn’t specify the run as)

can you share a screenshot of your function configurations

This is a screenshot of the module, page and workflow ( with the function option), as you can see at the moment the “query” field is empty and the RESULT that i see in the log is :

RESULT”=[{},{}]

Module

Page values

here it is, the screenshot of workflow, module and page

Could you show the namespace and module values in the function configuration (by clicking on them) to see if you selected the correct type and expression.

If the query is empty and the user that invokes the workflow has the permission to read those records/module/namespace then the records will be retrieved.
Without seeing the arguments (namespace/module) expanded, I cannot tell if the function is properly configured.

Here it is

This is an issue with the debug step and the used logger works (the empty {} inside of the array). It is annoying but we haven’t gotten to changing it yet.

If you want to inspect values of complex structures (non-primitive values such as strings, integers, booleans, …), you’ll be better off by using one of the logging functions.

For your case, since you searched for records (got a list of those), you can use an iterator (you can use the compose records iterator to fetch and iterate in one go) and use the logging function with item.values.yourField

Above is a quick snippet of how you can use the logger function to output record values; if you need, I can provide a better example on the evening/monday.