EdwardHefter
3 years agoQrew Cadet
Pipeline views {{e.id}} as the text "{{e.id}}" rather than the record ID number
This one has me confused. I have a step in a pipeline to update a field in a table with the record ID from another record in another table. I have a search in step E for records that match a criteria. If the records don't exist, the pipeline makes one and captures that new record's ID in the original record. If the record does exist, it (tries to) copy the record id of that record into the original record.
For some reason, Pipelines is seeing the record ID as the literal text {{e.id}} rather than the number. But, when it creates a record, it has no trouble using {{f.id}} (the created record) as a number.
I've included the YAML since I've spent an hour trying to figure out why one branch works and the other doesn't.
Any help on how to get the existing record ID copied over? Either what am I doing wrong, or a possible work around?
The specific error is:
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------
For some reason, Pipelines is seeing the record ID as the literal text {{e.id}} rather than the number. But, when it creates a record, it has no trouble using {{f.id}} (the created record) as a number.
I've included the YAML since I've spent an hour trying to figure out why one branch works and the other doesn't.
Any help on how to get the existing record ID copied over? Either what am I doing wrong, or a possible work around?
The specific error is:
- Validation error: Incorrect template "'{{e.id}}'". ValueError: invalid literal for int() with base 10: 'id'
- Input/output
Input (Mapping)
The record that worked is:
# Sunnytech - Move BOMs from PCBA Upload Table to PCB Scan Table
#
# Takes all of the records in the PCBA Upload Table and moves them to the
# Scans tables
#
# Account slugs:
# - quickbase[28nbQjo]: SunnyTech App <None>
---
- META:
name: Sunnytech - Move BOMs from PCBA Upload Table to PCB Scan Table
description: Takes all of the records in the PCBA Upload Table and moves them
to the Scans tables
- TRIGGER quickbase[28nbQjo] record on_new_event -> a:
export_fields: '"Ready to Import" <12>'
on_add_record: 'false'
on_delete_record: 'false'
on_modify_record: 'true'
table: '"SunnyTech Serial and Lot Tracking: PCBA Upload Table" <bsj24w3rd>'
trigger_fields: '"Ready to Import" <12>'
trigger_on_all_fields: 'false'
___: ___
FILTERS:
- AND:
- ready_to_import equals Importing Records to PCBA table
- QUERY quickbase[28nbQjo] record search -> b:
export_fields: '"Calculated Assembly PartID" <12, 11, 7, 9, 14>'
table: '"SunnyTech Serial and Lot Tracking: PCBA Upload Table" <bsj24w3rd>'
___: ___
- b<>LOOP:
- DO:
- IF:
- AND:
- b<>upload_problem set
- THEN:
- b<>ACTION quickbase record update -> c:
___: ___
ready_to_import: PROBLEM - Won't be imported!
- ELSE:
- b<>ACTION quickbase record update -> d:
___: ___
ready_to_import: Preparing to import this record
- QUERY quickbase[28nbQjo] record search -> e:
export_fields: '"ComponentID" <7>'
table: '"SunnyTech Serial and Lot Tracking: PCB Scans" <bse7txtrg>'
___: ___
FILTERS:
- AND:
- component_id equals {{b.calculated_assembly_part_id}}
- IF:
- AND:
- e<> empty
- THEN:
- ACTION quickbase[28nbQjo] record create -> f:
table: '"SunnyTech Serial and Lot Tracking: PCB Scans" <bse7txtrg>'
___: ___
component_id: '{{b.calculated_assembly_part_id}}'
- b<>ACTION quickbase record update -> g:
___: ___
pcb_scans_record_id: '{{f.id}}'
ready_to_import: Importing this record
- ELSE:
- b<>ACTION quickbase record update -> h:
___: ___
pcb_scans_record_id: '{{e.id}}'
ready_to_import: Importing this record
...
ready_to_import:"Importing this record"
pcb_scans_record_id:"'{{e.id}}'"
The record that worked is:
Input (Mapping)
ready_to_import:"Importing this record"
pcb_scans_record_id:"22"
Output
And, for those who have stuck around this long, here's the YAML:ready_to_import:"Importing this record"
pcb_scans_record_id:"22"
id:"351"
# Sunnytech - Move BOMs from PCBA Upload Table to PCB Scan Table
#
# Takes all of the records in the PCBA Upload Table and moves them to the
# Scans tables
#
# Account slugs:
# - quickbase[28nbQjo]: SunnyTech App <None>
---
- META:
name: Sunnytech - Move BOMs from PCBA Upload Table to PCB Scan Table
description: Takes all of the records in the PCBA Upload Table and moves them
to the Scans tables
- TRIGGER quickbase[28nbQjo] record on_new_event -> a:
export_fields: '"Ready to Import" <12>'
on_add_record: 'false'
on_delete_record: 'false'
on_modify_record: 'true'
table: '"SunnyTech Serial and Lot Tracking: PCBA Upload Table" <bsj24w3rd>'
trigger_fields: '"Ready to Import" <12>'
trigger_on_all_fields: 'false'
___: ___
FILTERS:
- AND:
- ready_to_import equals Importing Records to PCBA table
- QUERY quickbase[28nbQjo] record search -> b:
export_fields: '"Calculated Assembly PartID" <12, 11, 7, 9, 14>'
table: '"SunnyTech Serial and Lot Tracking: PCBA Upload Table" <bsj24w3rd>'
___: ___
- b<>LOOP:
- DO:
- IF:
- AND:
- b<>upload_problem set
- THEN:
- b<>ACTION quickbase record update -> c:
___: ___
ready_to_import: PROBLEM - Won't be imported!
- ELSE:
- b<>ACTION quickbase record update -> d:
___: ___
ready_to_import: Preparing to import this record
- QUERY quickbase[28nbQjo] record search -> e:
export_fields: '"ComponentID" <7>'
table: '"SunnyTech Serial and Lot Tracking: PCB Scans" <bse7txtrg>'
___: ___
FILTERS:
- AND:
- component_id equals {{b.calculated_assembly_part_id}}
- IF:
- AND:
- e<> empty
- THEN:
- ACTION quickbase[28nbQjo] record create -> f:
table: '"SunnyTech Serial and Lot Tracking: PCB Scans" <bse7txtrg>'
___: ___
component_id: '{{b.calculated_assembly_part_id}}'
- b<>ACTION quickbase record update -> g:
___: ___
pcb_scans_record_id: '{{f.id}}'
ready_to_import: Importing this record
- ELSE:
- b<>ACTION quickbase record update -> h:
___: ___
pcb_scans_record_id: '{{e.id}}'
ready_to_import: Importing this record
...
------------------------------
Edward Hefter
www.Sutubra.com
------------------------------