roganjoshua
(Customerbuilder.GitLab.get!("/projects/5112/pipelines/245667/variables", [{"Accept", "Application/json"}, {"PRIVATE-TOKEN", token}]) |> Map.get(:body),
This is an array of maps coming from gitlab
[
%{
"key" => "CUSTOMER",
"raw" => false,
"value" => "EOG.Acme.ManualXML",
"variable_type" => "env_var"
},
%{
"key" => "TRIGGER_PAYLOAD",
"raw" => false,
"value" => "{\"variables\":{\"CUSTOMER\":\"EOG.Acme.ManualXML\",\"VERSION\":\"Version-8.6.2\"},\"id\":\"5112\",\"ref\":\"main\"}",
"variable_type" => "file"
},
%{
"key" => "VERSION",
"raw" => false,
"value" => "Version-8.6.2",
"variable_type" => "env_var"
}
]
I want to put the version and customer into a new struct or something so I can pass it to a heex template. I need to add some other details like if the build is running/failed/success.
This seems easy but I am finding this difficult ![]()
|> Enum.into(%{ “key” => key})
|> Map.get(:body), :key)
|> Map.get(:body), “key”)
|> [ key: “CUSTOMER” ]
|> Map.get(:body) |> [ key: “CUSTOMER” ]
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Other Trending Topics
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
ICal is a library for interacting with iCalendar data. It parses iCalendars into typed Elixir structs via ICal.from_ics, and can prepare ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #ai
- #phoenix_html
- #elixirconf-us
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
Hi @roganjoshua can you show what you’ve tried so far?
dimitarvp
What’s the final shape of the data you want to arrive at?
roganjoshua
I want to iterate of the list in a <.table in the Heex - I think that is the right model?
dimitarvp
Where does
statuscome from? I can only seecustomerandversionin your initial snippet.roganjoshua
it comes from a previous request
This is sub-optimal but I am trying to sort of test to get something working
dimitarvp
There are a few things I could change but let’s get your stuff working first.
As Ben asked, what have you tried? You edited your first post but I didn’t find that snippet there convincing, or even fully related to the input data.
BTW do you know about
dbg/2? You can put it after each phase of your pipe to see how the data changed. Or you can just do it step by step iniex.To me it’s fairly easy to get
customerandversionfrom your original map and convert it like you need but I’d like to see your thought process and how would you go about solving the problem.roganjoshua
I didn’t know about dbg/2
roganjoshua
dimitarvp
That shouldn’t even compile, no?
roganjoshua
probably not