Misleading documentation for action-listops widget

I am trying to do something simple but can not find the correct code to get it to work.

I have a form with a button to create a tiddler based on values entered through this form.

If the newly created tiddler has fields Longitude and Latitude having non empty values, I want to add the tag $:/tags/GeoMarker to the tag list for the tiddler.

I have tried many different things to no avail.

The latest iteration is

     <$action-createtiddler 
        $basetitle={{{ [<gunID>] }}}
         caption={{{ [<selectedstatename>addsuffix[ : ]addsuffix<cityTag>addsuffix[ - ]addsuffix{$:/TLS/type}] }}}
         tags={{{ [[All Guns]] [<cityTag>] [<selectedstatename >] [<locationTag>] [<typeTag>] +[format:titlelist[]join[ ]] }}}
          ID={{{ [<gunID>] }}}
          CityTown={{$:/TLS/city}}
          Location={{$:/TLS/location}}
          State=<<selectedstatename>>
         GunType={{$:/TLS/type}}
          DateofManufacture={{$:/TLS/dateofmanufacture}}
          Manufacturer={{$:/TLS/manufacturer}}
          SerialNumber={{$:/TLS/serialnumber}}
          WeightofProjectile={{$:/TLS/weightofprojectile}}
          Range={{$:/TLS/range}}
          pictureLink={{$:/TLS/pictureLink}}
          Calibre={{$:/TLS/calibre}}
          Longitude={{$:/TLS/longitude}}
          Latitude={{$:/TLS/latitude}}
           $template="$:/TLS/CreateTemplateGun">
         <$action-navigate $to=<<createTiddler-title>>/>
 
            </$action-createtiddler>
          
           <%if [title[<gunID>]has[Longitude]has[Latitude]]%>
                    <$action-listops $tags="$:/tags/GeoMarker"/>
          <%endif%>

I assume the %if statement is not addressing the newly created tiddler.

could someone show me where I am going wrong.

thanks

bobj

You need to move the conditional inside the $action-createtiddler body, and make it refer to the <<createTiddler-title>>. I suggest just before the $action-navigate, like this:

<%if [<createTiddler-title>has[Longitude]has[Latitude]]%>
    <$action-listops $tags="$:/tags/GeoMarker"/>
<%endif%>
<$action-navigate $to=<<createTiddler-title>>/>

enjoy,
-e

maybe you could give more details,this is my solution.

\procedure createTidAction()
<$action-createtiddler 
        $basetitle=<<gunTitle>>
         caption={{{ [<selectedstatename>addsuffix[ : ]addsuffix<cityTag>addsuffix[ - ]addsuffix{$:/TLS/type}] }}}
         tags={{{ [[All Guns]] [<cityTag>] [<selectedstatename >] [<locationTag>] [<typeTag>] +[format:titlelist[]join[ ]] }}}
          ID={{{ [<gunID>] }}}
          CityTown={{$:/TLS/city}}
          Location={{$:/TLS/location}}
          State=<<selectedstatename>>
         GunType={{$:/TLS/type}}
          DateofManufacture={{$:/TLS/dateofmanufacture}}
          Manufacturer={{$:/TLS/manufacturer}}
          SerialNumber={{$:/TLS/serialnumber}}
          WeightofProjectile={{$:/TLS/weightofprojectile}}
          Range={{$:/TLS/range}}
          pictureLink={{$:/TLS/pictureLink}}
          Calibre={{$:/TLS/calibre}}
          Longitude={{$:/TLS/longitude}}
          Latitude={{$:/TLS/latitude}}
           $template="$:/TLS/CreateTemplateGun">
</$action-createtiddler>
\end

\procedure GeoAction()
<%if [<gunTitle>has[Longitude]has[Latitude]]%>
 <$action-listops $tags="$:/tags/GeoMarker"/>
<%endif%>
<$action-navigate $to=<<createTiddler-title>>/>
\end

<$let gunTitle={{{ [<gunID>] }}} >
<$button actions=<<GeoAction>> >
<<createTidAction>>
some text
</$button>
</$let>

If it din’t work,please give more details.I can’t test it for I don’t have a tiddler contains your from.

@EricShulman did what you suggested and it added the geomarker tag to the ‘add new gun’ tiddler, ie. the form for adding a new gun, not the new gun tiddler itself.

Even if I move the action-navigateto step before the conditional, it does the same thing, adds the tag to the form tiddler not the newly created tiddler.

However, the conditional step seems to check the new tiddler’s lat and long fields because the form does not have those at all.

Back to the drawing board…

bobj

@dongrentianyu here is the form tiddler as a json

$__TLS_Actions_Add New Gun.json (5.4 KB)

bobj

This reminds me of a commit failure in database processing, the new record has been created but the creation is not yet committed.

This begs the question. When after a create step, is the new tiddler committed for further processing?

In this case, I suspect it is committed enough for the conditional to pass but not yet committed enough for the action step to take place on it.

Or maybe the new tiddler is not yet the focus of the story river yet. for the action step to occur successfully.

bobj

Fixed it!!

All it needed was the specification of the $tiddler attribute in the action-listops widget step. This indicates the documentation for action-listops is misleading as it specifically gives the example

I only found this as I was looking through the ‘Extended Listops Filters’ tiddler.

bobj

Have you solved your problem? I’d look at that tiddler above if you hadn’t solved it.

Yes solved as I noted in my previous post.

Thanks for your input though, it is appreciated.

Bobj